package com.oocl.util;

import java.io.UnsupportedEncodingException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

public class Md5Digect {
	public static String GetMD5Code(String strObj) {
        String resultString = null;
        try {
			MessageDigest md = MessageDigest.getInstance("MD5");
			byte[] resu = md.digest(strObj.getBytes("ISO-8859-1"));
			resultString = new String(resu,"ISO-8859-1");
		} catch (NoSuchAlgorithmException e) {
			e.printStackTrace();
		} catch (UnsupportedEncodingException e) {
			e.printStackTrace();
		}
        return resultString;
    }
	
	public static void main(String[] args) {
		String string = "1233";
		System.out.println(Md5Digect.GetMD5Code(string));
	}
}
